<%= form_for(@eating) do |f| %>
  <% if @eating.errors.any? %>
    <div id="error_explanation">
      <h2><%=@eating.errors.count%> <%=t('common.error') %> <%=t('message.error.eating.header')%></h2>

      <ul>
      <% @eating.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  <%= f.hidden_field :enabled%>
  <%= f.hidden_field :weight_id%>
  <div class="field margin-top10">
    <%= label_tag "time", t('field.eating.time'), :class => "form-label" %>
    <%= f.time_select :time, :id => "time"%>
    <div class="eating-type-select-wrapper">
        <%= label_tag "eating_type_id", t('field.eating.eating_type'), :class => "form-label"%>
        <%= collection_select(:eating, :eating_type_id, @eating_types, :id, :name,
                              {:include_blank => t('common.undefined')}, {:id => "eating_type_id", :class=>"eating-type-select"})%>
    </div>
  </div>
  <div class="field margin-top10">
    <%= label_tag "food", t('field.eating.food'), :class => "form-label" %><br />
    <%= f.text_area :food, :size => "60x6", :class => "text-area", :id => "food" %>
  </div>
  <div class="field margin-top10">
    <%= label_tag "overweightId", t('field.eating.overweight'), :class => "form-label" %>
    <%= f.check_box :overweight, :id =>"overweightId", :class => "input-field training-input-field" %>
    <%= label_tag "violationId", t('field.eating.violation'), :class => "form-label" %>
    <%= f.check_box :violation, :id =>"violationId", :class => "input-field training-input-field" %>
  </div>
  <div class="actions form-buttons">
     <%= f.submit "", :class=>"save-button", :title=>t('button.save')%>
  </div>
<% end %>

<script type="text/javascript">
    jQuery(document).ready(function(){
        initEatingForm();
    });
</script>